/*
* Copyright (c) 2020 - 2025 Renesas Electronics Corporation and/or its affiliates
*
* SPDX-License-Identifier: BSD-3-Clause
*/

/***********************************************************************************************************************
 * Includes
 **********************************************************************************************************************/
#include "r_rsip_primitive.h"
#include "r_rsip_util.h"

/***********************************************************************************************************************
 * Global variables
 **********************************************************************************************************************/

uint32_t         S_RAM[RSIP_PRV_WORD_SIZE_S_RAM];
uint32_t         S_HEAP[RSIP_PRV_WORD_SIZE_S_HEAP];
uint32_t const * S_INST2;
uint32_t         INST_DATA_SIZE;

uint32_t const DomainParam_NIST_P256[] =
{
    BSWAP_32BIG_C(0x44bec87cU), BSWAP_32BIG_C(0x0cefbbbaU), BSWAP_32BIG_C(0x3ff586d1U), BSWAP_32BIG_C(0x49388147U),
    BSWAP_32BIG_C(0x1968ff99U), BSWAP_32BIG_C(0xc3f2fdf1U), BSWAP_32BIG_C(0xcace9d09U), BSWAP_32BIG_C(0xae59f9f1U),
    BSWAP_32BIG_C(0x701b4f04U), BSWAP_32BIG_C(0x9aadf3f1U), BSWAP_32BIG_C(0x3175dba4U), BSWAP_32BIG_C(0xa7672f59U),
    BSWAP_32BIG_C(0xdd86b2e0U), BSWAP_32BIG_C(0xd5885522U), BSWAP_32BIG_C(0xb956368bU), BSWAP_32BIG_C(0x13699018U),
    BSWAP_32BIG_C(0xa7d1811bU), BSWAP_32BIG_C(0x4cc0714aU), BSWAP_32BIG_C(0xc110ee3bU), BSWAP_32BIG_C(0x2f84dff0U),
    BSWAP_32BIG_C(0x0129c0fcU), BSWAP_32BIG_C(0x6a5012feU), BSWAP_32BIG_C(0x3adf648fU), BSWAP_32BIG_C(0x9a67df66U),
    BSWAP_32BIG_C(0xd04ba255U), BSWAP_32BIG_C(0x112d9cc2U), BSWAP_32BIG_C(0x2a526f1aU), BSWAP_32BIG_C(0x25ff0f18U),
    BSWAP_32BIG_C(0x5aee33baU), BSWAP_32BIG_C(0xe4060596U), BSWAP_32BIG_C(0x39a919abU), BSWAP_32BIG_C(0x319bbddaU),
    BSWAP_32BIG_C(0xc8a0ea78U), BSWAP_32BIG_C(0x30105ed5U), BSWAP_32BIG_C(0xb6c06bf0U), BSWAP_32BIG_C(0x355667aaU),
    BSWAP_32BIG_C(0x8228c96aU), BSWAP_32BIG_C(0xdf952b61U), BSWAP_32BIG_C(0x0518ab1fU), BSWAP_32BIG_C(0x80fba944U),
    BSWAP_32BIG_C(0xccc1ebbbU), BSWAP_32BIG_C(0x0fdf0b87U), BSWAP_32BIG_C(0x0568ae3dU), BSWAP_32BIG_C(0x7178e052U),
    BSWAP_32BIG_C(0x9a099e59U), BSWAP_32BIG_C(0xb1b080d2U), BSWAP_32BIG_C(0x251e8753U), BSWAP_32BIG_C(0x8463ccd1U),
    BSWAP_32BIG_C(0x877593c4U), BSWAP_32BIG_C(0x859abefdU), BSWAP_32BIG_C(0xf1f5fa0bU), BSWAP_32BIG_C(0xdf51151dU),
    BSWAP_32BIG_C(0x6cc533d7U), BSWAP_32BIG_C(0x88233529U), BSWAP_32BIG_C(0x26de4d41U), BSWAP_32BIG_C(0x1188912fU),
    BSWAP_32BIG_C(0xcac5c237U), BSWAP_32BIG_C(0xcff830beU), BSWAP_32BIG_C(0x0d37ee47U), BSWAP_32BIG_C(0x7fb8b769U),
    BSWAP_32BIG_C(0x8035f595U), BSWAP_32BIG_C(0x337802ccU), BSWAP_32BIG_C(0x652d7e37U), BSWAP_32BIG_C(0x184ea78bU),
    BSWAP_32BIG_C(0xbad33232U), BSWAP_32BIG_C(0xed8ff3c0U), BSWAP_32BIG_C(0xff8efadfU), BSWAP_32BIG_C(0xa926be4dU),
    BSWAP_32BIG_C(0x8034ce3aU), BSWAP_32BIG_C(0xcc734f7dU), BSWAP_32BIG_C(0x45b4e085U), BSWAP_32BIG_C(0x13350be3U),
};

uint32_t const DomainParam_NIST_P384[] =
{
    BSWAP_32BIG_C(0x74a2a9c8U), BSWAP_32BIG_C(0xd758824aU), BSWAP_32BIG_C(0x8b4fd8e0U), BSWAP_32BIG_C(0x6136c728U),
    BSWAP_32BIG_C(0x4a3e08dcU), BSWAP_32BIG_C(0x15859830U), BSWAP_32BIG_C(0x9899a1ffU), BSWAP_32BIG_C(0x8c66d8afU),
    BSWAP_32BIG_C(0x3cfd78f4U), BSWAP_32BIG_C(0x9a63ec7bU), BSWAP_32BIG_C(0x6ce0c4b9U), BSWAP_32BIG_C(0x84613736U),
    BSWAP_32BIG_C(0xeaeb7045U), BSWAP_32BIG_C(0x1d76ef28U), BSWAP_32BIG_C(0x4434f6d4U), BSWAP_32BIG_C(0x9ee15c48U),
    BSWAP_32BIG_C(0x041f13c5U), BSWAP_32BIG_C(0xc76abb36U), BSWAP_32BIG_C(0xae019d3dU), BSWAP_32BIG_C(0xfb0b3ad5U),
    BSWAP_32BIG_C(0x09dcc449U), BSWAP_32BIG_C(0xc2f3915bU), BSWAP_32BIG_C(0x986f6d30U), BSWAP_32BIG_C(0x3f3e1ba8U),
    BSWAP_32BIG_C(0x78dffb4bU), BSWAP_32BIG_C(0x3d6594d6U), BSWAP_32BIG_C(0x44a46bcfU), BSWAP_32BIG_C(0xcada9f68U),
    BSWAP_32BIG_C(0xde8c5914U), BSWAP_32BIG_C(0xe64230e3U), BSWAP_32BIG_C(0x0494fe6aU), BSWAP_32BIG_C(0xc0533d6fU),
    BSWAP_32BIG_C(0xd0013b15U), BSWAP_32BIG_C(0x428c954fU), BSWAP_32BIG_C(0xc3851f2aU), BSWAP_32BIG_C(0x8c34b53fU),
    BSWAP_32BIG_C(0xae4efd0eU), BSWAP_32BIG_C(0x1f224fc9U), BSWAP_32BIG_C(0x043779fbU), BSWAP_32BIG_C(0x0af9ca7fU),
    BSWAP_32BIG_C(0xc60f8052U), BSWAP_32BIG_C(0xaafb11a6U), BSWAP_32BIG_C(0xcb44fb62U), BSWAP_32BIG_C(0x79ed6a93U),
    BSWAP_32BIG_C(0x9e54c762U), BSWAP_32BIG_C(0x7f774b1cU), BSWAP_32BIG_C(0x04c79b9eU), BSWAP_32BIG_C(0xf0095010U),
    BSWAP_32BIG_C(0xaa488b78U), BSWAP_32BIG_C(0x84706d08U), BSWAP_32BIG_C(0xd3eac7beU), BSWAP_32BIG_C(0x68562f3dU),
    BSWAP_32BIG_C(0x8f0f762cU), BSWAP_32BIG_C(0xc537f555U), BSWAP_32BIG_C(0x237658fdU), BSWAP_32BIG_C(0xfde8fdd2U),
    BSWAP_32BIG_C(0x4f7e0918U), BSWAP_32BIG_C(0xf6bc5100U), BSWAP_32BIG_C(0xfd9fc171U), BSWAP_32BIG_C(0x519acb8eU),
    BSWAP_32BIG_C(0x6a1dbe19U), BSWAP_32BIG_C(0x3e1ade41U), BSWAP_32BIG_C(0x13e7d4dcU), BSWAP_32BIG_C(0x140698dbU),
    BSWAP_32BIG_C(0x78b9f550U), BSWAP_32BIG_C(0xa59dda52U), BSWAP_32BIG_C(0x82894418U), BSWAP_32BIG_C(0x80feea41U),
    BSWAP_32BIG_C(0x72cc2f0dU), BSWAP_32BIG_C(0x483f6cf8U), BSWAP_32BIG_C(0xe0ec05cfU), BSWAP_32BIG_C(0x8e62167fU),
    BSWAP_32BIG_C(0x4dc710c3U), BSWAP_32BIG_C(0x44d9c665U), BSWAP_32BIG_C(0x2e92a077U), BSWAP_32BIG_C(0xd9cbce4fU),
    BSWAP_32BIG_C(0xc9ad1a4cU), BSWAP_32BIG_C(0x1685baaaU), BSWAP_32BIG_C(0xaff43abdU), BSWAP_32BIG_C(0xdb723142U),
    BSWAP_32BIG_C(0x984caa06U), BSWAP_32BIG_C(0xe071783eU), BSWAP_32BIG_C(0xffaf06e8U), BSWAP_32BIG_C(0x0fb07fd5U),
    BSWAP_32BIG_C(0x1d3c4ef5U), BSWAP_32BIG_C(0x7ba513acU), BSWAP_32BIG_C(0xa45e8d5dU), BSWAP_32BIG_C(0x703a68c3U),
    BSWAP_32BIG_C(0x3a4c979fU), BSWAP_32BIG_C(0xd7c2e6abU), BSWAP_32BIG_C(0xd21cd2aeU), BSWAP_32BIG_C(0x6214d6d9U),
    BSWAP_32BIG_C(0xf9addb9eU), BSWAP_32BIG_C(0x9753ac14U), BSWAP_32BIG_C(0x4d1dea1cU), BSWAP_32BIG_C(0x7514f6c1U),
    BSWAP_32BIG_C(0x91ce015cU), BSWAP_32BIG_C(0xe58067a3U), BSWAP_32BIG_C(0xdcf30849U), BSWAP_32BIG_C(0x3fde5b81U),
    BSWAP_32BIG_C(0x833508c7U), BSWAP_32BIG_C(0xb2a8b87aU), BSWAP_32BIG_C(0xed368a55U), BSWAP_32BIG_C(0x985138feU),
};

uint32_t const DomainParam_Ed25519[] =
{
    BSWAP_32BIG_C(0x55b74a96U), BSWAP_32BIG_C(0xc5c9927cU), BSWAP_32BIG_C(0xed7d8724U), BSWAP_32BIG_C(0x57697bfbU),
    BSWAP_32BIG_C(0x547aad6bU), BSWAP_32BIG_C(0x222703efU), BSWAP_32BIG_C(0xab07d479U), BSWAP_32BIG_C(0xfbad514dU),
    BSWAP_32BIG_C(0x06eaca2cU), BSWAP_32BIG_C(0x41b6d0c7U), BSWAP_32BIG_C(0xe1384a09U), BSWAP_32BIG_C(0x4e0ad956U),
    BSWAP_32BIG_C(0x0a9f311cU), BSWAP_32BIG_C(0xdd777c81U), BSWAP_32BIG_C(0x9359a10cU), BSWAP_32BIG_C(0x1721ce73U),
    BSWAP_32BIG_C(0x57ad5ac1U), BSWAP_32BIG_C(0x69b07c32U), BSWAP_32BIG_C(0x6fe4dd84U), BSWAP_32BIG_C(0xffdc2efcU),
    BSWAP_32BIG_C(0x48df6c0aU), BSWAP_32BIG_C(0x910e9cc2U), BSWAP_32BIG_C(0xe2cc47f0U), BSWAP_32BIG_C(0x955e1230U),
    BSWAP_32BIG_C(0x8b4b1542U), BSWAP_32BIG_C(0x74008ce3U), BSWAP_32BIG_C(0xbce3e13eU), BSWAP_32BIG_C(0xe58c91ceU),
    BSWAP_32BIG_C(0x4a791be6U), BSWAP_32BIG_C(0x30d7673cU), BSWAP_32BIG_C(0xbd5995baU), BSWAP_32BIG_C(0x4c8169f9U),
    BSWAP_32BIG_C(0xafc70e86U), BSWAP_32BIG_C(0xa02fee7dU), BSWAP_32BIG_C(0x20f93a12U), BSWAP_32BIG_C(0xc4366e40U),
    BSWAP_32BIG_C(0x2445db2eU), BSWAP_32BIG_C(0xf7c00abaU), BSWAP_32BIG_C(0x5663afffU), BSWAP_32BIG_C(0x1184e601U),
    BSWAP_32BIG_C(0xd7c0d042U), BSWAP_32BIG_C(0xc712b790U), BSWAP_32BIG_C(0xa3f73866U), BSWAP_32BIG_C(0xfc12705fU),
    BSWAP_32BIG_C(0x5de4ecb1U), BSWAP_32BIG_C(0xa30048e9U), BSWAP_32BIG_C(0x5be50fa8U), BSWAP_32BIG_C(0x84478ae0U),
    BSWAP_32BIG_C(0x713b4465U), BSWAP_32BIG_C(0xd16d4689U), BSWAP_32BIG_C(0x23788ae6U), BSWAP_32BIG_C(0xbb99ddd6U),
    BSWAP_32BIG_C(0x674d4005U), BSWAP_32BIG_C(0x174d7b81U), BSWAP_32BIG_C(0x820d5171U), BSWAP_32BIG_C(0x28e933fcU),
    BSWAP_32BIG_C(0x08f34bc6U), BSWAP_32BIG_C(0x985d1582U), BSWAP_32BIG_C(0xf75ca334U), BSWAP_32BIG_C(0x50b128bcU),
    BSWAP_32BIG_C(0x44316e00U), BSWAP_32BIG_C(0x43cbd006U), BSWAP_32BIG_C(0x7b195c04U), BSWAP_32BIG_C(0xa0787401U),
    BSWAP_32BIG_C(0x05e43acaU), BSWAP_32BIG_C(0xe1a8c608U), BSWAP_32BIG_C(0x5ba02d7dU), BSWAP_32BIG_C(0x25db8bdeU),
    BSWAP_32BIG_C(0x19baa22dU), BSWAP_32BIG_C(0x655a1ce3U), BSWAP_32BIG_C(0x9cae8d67U), BSWAP_32BIG_C(0xf3dc0e9aU),
    BSWAP_32BIG_C(0x83acd5f2U), BSWAP_32BIG_C(0xa352a538U), BSWAP_32BIG_C(0xb718b254U), BSWAP_32BIG_C(0x7fd4fc28U),
};

uint32_t const DomainParam_Brainpool_256r1[] =
{
    BSWAP_32BIG_C(0x00d6fdd7U), BSWAP_32BIG_C(0x9ad0a933U), BSWAP_32BIG_C(0x70fed48aU), BSWAP_32BIG_C(0xc9a320d1U),
    BSWAP_32BIG_C(0x7626137fU), BSWAP_32BIG_C(0xb83a44b8U), BSWAP_32BIG_C(0x13ae7041U), BSWAP_32BIG_C(0x4467a6ecU),
    BSWAP_32BIG_C(0x9d0171b8U), BSWAP_32BIG_C(0x89800a82U), BSWAP_32BIG_C(0xf7c04c83U), BSWAP_32BIG_C(0x2ce53af2U),
    BSWAP_32BIG_C(0xeecbb9feU), BSWAP_32BIG_C(0x2ec0efbfU), BSWAP_32BIG_C(0x81eea173U), BSWAP_32BIG_C(0x828bbbdfU),
    BSWAP_32BIG_C(0xd969240dU), BSWAP_32BIG_C(0x6bffa583U), BSWAP_32BIG_C(0x4814b742U), BSWAP_32BIG_C(0xabd8e604U),
    BSWAP_32BIG_C(0x68cc3f50U), BSWAP_32BIG_C(0x33d735b1U), BSWAP_32BIG_C(0xecc37669U), BSWAP_32BIG_C(0x6c7f86a9U),
    BSWAP_32BIG_C(0xf16d94e9U), BSWAP_32BIG_C(0x57721162U), BSWAP_32BIG_C(0x93af399fU), BSWAP_32BIG_C(0x4e4d6f3cU),
    BSWAP_32BIG_C(0xf13f7527U), BSWAP_32BIG_C(0xb26cdc44U), BSWAP_32BIG_C(0xf825c89dU), BSWAP_32BIG_C(0x48bd26ceU),
    BSWAP_32BIG_C(0x1ec254a9U), BSWAP_32BIG_C(0x4ae7fc8eU), BSWAP_32BIG_C(0xaa730974U), BSWAP_32BIG_C(0x22e01151U),
    BSWAP_32BIG_C(0x34282b93U), BSWAP_32BIG_C(0x65e5da95U), BSWAP_32BIG_C(0x5d055042U), BSWAP_32BIG_C(0xe63ff062U),
    BSWAP_32BIG_C(0x2f26f9b5U), BSWAP_32BIG_C(0x5144fe3aU), BSWAP_32BIG_C(0xd8355d70U), BSWAP_32BIG_C(0xdf3b1527U),
    BSWAP_32BIG_C(0x7dd2176dU), BSWAP_32BIG_C(0xab1a0411U), BSWAP_32BIG_C(0xe03d0718U), BSWAP_32BIG_C(0x4ddc48d1U),
    BSWAP_32BIG_C(0x9e884ba9U), BSWAP_32BIG_C(0x63ba12b2U), BSWAP_32BIG_C(0x9d180af5U), BSWAP_32BIG_C(0xdd1c6f80U),
    BSWAP_32BIG_C(0xb5e6632eU), BSWAP_32BIG_C(0x92d2a927U), BSWAP_32BIG_C(0x437faf4dU), BSWAP_32BIG_C(0x52cd5c11U),
    BSWAP_32BIG_C(0x0da35819U), BSWAP_32BIG_C(0xdd0c922cU), BSWAP_32BIG_C(0xa4f4c698U), BSWAP_32BIG_C(0xc244fc30U),
    BSWAP_32BIG_C(0x1a38d738U), BSWAP_32BIG_C(0x792fc9bdU), BSWAP_32BIG_C(0x1e820cacU), BSWAP_32BIG_C(0x7e4b3dd4U),
    BSWAP_32BIG_C(0x38ecda6bU), BSWAP_32BIG_C(0x9e560752U), BSWAP_32BIG_C(0x299b5934U), BSWAP_32BIG_C(0xf977d6ceU),
    BSWAP_32BIG_C(0xd1f7a402U), BSWAP_32BIG_C(0xace8b3e7U), BSWAP_32BIG_C(0x3f6fda58U), BSWAP_32BIG_C(0x39e894b8U),
};

uint32_t const DomainParam_Brainpool_384r1[] =
{
    BSWAP_32BIG_C(0x3b289c96U), BSWAP_32BIG_C(0xb865cfb3U), BSWAP_32BIG_C(0x22ffab35U), BSWAP_32BIG_C(0x311cf67bU),
    BSWAP_32BIG_C(0x8ea85872U), BSWAP_32BIG_C(0x8fba6dc6U), BSWAP_32BIG_C(0xc2092a17U), BSWAP_32BIG_C(0x09dfc308U),
    BSWAP_32BIG_C(0x968d80dbU), BSWAP_32BIG_C(0x16db5c3aU), BSWAP_32BIG_C(0x5bb3e975U), BSWAP_32BIG_C(0x2df9b7ebU),
    BSWAP_32BIG_C(0x04443a33U), BSWAP_32BIG_C(0x3c5a59e4U), BSWAP_32BIG_C(0x28e333dfU), BSWAP_32BIG_C(0xc34d9933U),
    BSWAP_32BIG_C(0x95829c25U), BSWAP_32BIG_C(0x3392fb31U), BSWAP_32BIG_C(0xe73f8064U), BSWAP_32BIG_C(0x89f2121aU),
    BSWAP_32BIG_C(0x2f7d3157U), BSWAP_32BIG_C(0x0120674eU), BSWAP_32BIG_C(0xafbfe709U), BSWAP_32BIG_C(0x6cce9e7bU),
    BSWAP_32BIG_C(0x68c75a8cU), BSWAP_32BIG_C(0x4acdfa5bU), BSWAP_32BIG_C(0x834ff8e8U), BSWAP_32BIG_C(0xac95857dU),
    BSWAP_32BIG_C(0x5a10361aU), BSWAP_32BIG_C(0xbab9ea4cU), BSWAP_32BIG_C(0x086e7dbcU), BSWAP_32BIG_C(0xa86bbc39U),
    BSWAP_32BIG_C(0x43bcdb0fU), BSWAP_32BIG_C(0x5ded477aU), BSWAP_32BIG_C(0x65634f4eU), BSWAP_32BIG_C(0x40bb309dU),
    BSWAP_32BIG_C(0xfc90c4ffU), BSWAP_32BIG_C(0x4d7011c0U), BSWAP_32BIG_C(0x9b9aca23U), BSWAP_32BIG_C(0x55d323d0U),
    BSWAP_32BIG_C(0x0f36cdccU), BSWAP_32BIG_C(0xae21b008U), BSWAP_32BIG_C(0xf15028d6U), BSWAP_32BIG_C(0x9c04e6dbU),
    BSWAP_32BIG_C(0x04036a40U), BSWAP_32BIG_C(0x191a8e21U), BSWAP_32BIG_C(0x9b4ee06dU), BSWAP_32BIG_C(0x21bcd1b6U),
    BSWAP_32BIG_C(0xf5b97cf2U), BSWAP_32BIG_C(0xa0983157U), BSWAP_32BIG_C(0xdf100d50U), BSWAP_32BIG_C(0x915aa203U),
    BSWAP_32BIG_C(0x98238f27U), BSWAP_32BIG_C(0xd8bda18cU), BSWAP_32BIG_C(0x3ca97d31U), BSWAP_32BIG_C(0x8aadfce2U),
    BSWAP_32BIG_C(0xf44a551fU), BSWAP_32BIG_C(0x7c68cca2U), BSWAP_32BIG_C(0x6d57298eU), BSWAP_32BIG_C(0x4f8e16e3U),
    BSWAP_32BIG_C(0x06b00082U), BSWAP_32BIG_C(0xc2ee71f7U), BSWAP_32BIG_C(0xc4a8583aU), BSWAP_32BIG_C(0x7678ec14U),
    BSWAP_32BIG_C(0x82eaed83U), BSWAP_32BIG_C(0x951166a3U), BSWAP_32BIG_C(0x260b17b3U), BSWAP_32BIG_C(0x6bb1de0bU),
    BSWAP_32BIG_C(0xc63083bfU), BSWAP_32BIG_C(0x8b13778cU), BSWAP_32BIG_C(0x871a6e9fU), BSWAP_32BIG_C(0x6a7feb1eU),
    BSWAP_32BIG_C(0x57ae1633U), BSWAP_32BIG_C(0x2860bd78U), BSWAP_32BIG_C(0xef776305U), BSWAP_32BIG_C(0xed192e8fU),
    BSWAP_32BIG_C(0xd6a26e9cU), BSWAP_32BIG_C(0xd4e519deU), BSWAP_32BIG_C(0x0a06e38dU), BSWAP_32BIG_C(0xaceae57eU),
    BSWAP_32BIG_C(0x20846318U), BSWAP_32BIG_C(0x7f71c440U), BSWAP_32BIG_C(0xb5d0de36U), BSWAP_32BIG_C(0x7a55a68fU),
    BSWAP_32BIG_C(0x8446a407U), BSWAP_32BIG_C(0x683b907aU), BSWAP_32BIG_C(0xa6615760U), BSWAP_32BIG_C(0x66785ddfU),
    BSWAP_32BIG_C(0x6ede7274U), BSWAP_32BIG_C(0x8ab826f2U), BSWAP_32BIG_C(0xcfef8a73U), BSWAP_32BIG_C(0x01aa45a9U),
    BSWAP_32BIG_C(0xb41401b2U), BSWAP_32BIG_C(0x0ade35e8U), BSWAP_32BIG_C(0x575fe7edU), BSWAP_32BIG_C(0x7d664982U),
    BSWAP_32BIG_C(0xb09f4298U), BSWAP_32BIG_C(0x7c4f0c2dU), BSWAP_32BIG_C(0xc907801dU), BSWAP_32BIG_C(0xd488698dU),
    BSWAP_32BIG_C(0x5376a0ffU), BSWAP_32BIG_C(0xd4f33697U), BSWAP_32BIG_C(0xd11ab964U), BSWAP_32BIG_C(0xe9383434U),
};

uint32_t const DomainParam_Koblitz_secp256k1[] =
{
    BSWAP_32BIG_C(0xa3e2d64dU), BSWAP_32BIG_C(0x134ddd7cU), BSWAP_32BIG_C(0x58037e63U), BSWAP_32BIG_C(0xb705f094U),
    BSWAP_32BIG_C(0xde7577fcU), BSWAP_32BIG_C(0xcd01a94fU), BSWAP_32BIG_C(0x9883daecU), BSWAP_32BIG_C(0xd35b43a4U),
    BSWAP_32BIG_C(0xaaf75d97U), BSWAP_32BIG_C(0x474f3b9cU), BSWAP_32BIG_C(0x05d47b8dU), BSWAP_32BIG_C(0x49343729U),
    BSWAP_32BIG_C(0xba114808U), BSWAP_32BIG_C(0xa3679099U), BSWAP_32BIG_C(0x1b7f7de5U), BSWAP_32BIG_C(0x8c6379fdU),
    BSWAP_32BIG_C(0x777924b8U), BSWAP_32BIG_C(0x47ad333fU), BSWAP_32BIG_C(0x24a940a6U), BSWAP_32BIG_C(0x391ca2d2U),
    BSWAP_32BIG_C(0xc791ac77U), BSWAP_32BIG_C(0xbf015dbcU), BSWAP_32BIG_C(0xa36d601bU), BSWAP_32BIG_C(0x1a8ffe9cU),
    BSWAP_32BIG_C(0xbedb51d5U), BSWAP_32BIG_C(0x2a990c5fU), BSWAP_32BIG_C(0x0036ba33U), BSWAP_32BIG_C(0xb1eaf440U),
    BSWAP_32BIG_C(0xe9c336c6U), BSWAP_32BIG_C(0x54b07b55U), BSWAP_32BIG_C(0x13133492U), BSWAP_32BIG_C(0xa443d449U),
    BSWAP_32BIG_C(0x9740a0c5U), BSWAP_32BIG_C(0x14216c78U), BSWAP_32BIG_C(0xd20ebf2eU), BSWAP_32BIG_C(0x66a654bcU),
    BSWAP_32BIG_C(0xd6b69e41U), BSWAP_32BIG_C(0x76f9ce6cU), BSWAP_32BIG_C(0xd7ba72a5U), BSWAP_32BIG_C(0x7d233015U),
    BSWAP_32BIG_C(0xfd1cd09bU), BSWAP_32BIG_C(0x095485abU), BSWAP_32BIG_C(0xe82cbb05U), BSWAP_32BIG_C(0x050317d9U),
    BSWAP_32BIG_C(0xb008033cU), BSWAP_32BIG_C(0x1d58ba0aU), BSWAP_32BIG_C(0x0b46685cU), BSWAP_32BIG_C(0xa6eb6d44U),
    BSWAP_32BIG_C(0x0ea55fb0U), BSWAP_32BIG_C(0x13005bd9U), BSWAP_32BIG_C(0x189720f8U), BSWAP_32BIG_C(0x7bba92f3U),
    BSWAP_32BIG_C(0xf3a1b2f1U), BSWAP_32BIG_C(0xfc7d5980U), BSWAP_32BIG_C(0xc2cc333cU), BSWAP_32BIG_C(0x0e4452c5U),
    BSWAP_32BIG_C(0x58d72b23U), BSWAP_32BIG_C(0xc4ac428dU), BSWAP_32BIG_C(0xf2d4c54bU), BSWAP_32BIG_C(0x5d560491U),
    BSWAP_32BIG_C(0x1a991c6eU), BSWAP_32BIG_C(0xcbc9a336U), BSWAP_32BIG_C(0xceba5ebbU), BSWAP_32BIG_C(0xb6d508feU),
    BSWAP_32BIG_C(0x50528fdaU), BSWAP_32BIG_C(0x44f0524bU), BSWAP_32BIG_C(0x2b3042faU), BSWAP_32BIG_C(0x5e0fd2b5U),
    BSWAP_32BIG_C(0x579325eeU), BSWAP_32BIG_C(0x9ead0418U), BSWAP_32BIG_C(0x868d8cfdU), BSWAP_32BIG_C(0x4a58b279U),
};
